﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows.Media;
using DevExpress.XtraScheduler;
using AppointmentStatus = DevExpress.Xpf.Scheduler.AppointmentStatus;

namespace Agnes.TaskManager
{
    class StatusTypeToStringConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            foreach (AppointmentStatus i in TaskManagerService.TaskManager.SchedulerStorage.AppointmentStorage.Statuses)
            {
                if (i.Type == (AppointmentStatusType)value)
                {
                    return i.DisplayName;
                }
            }

            return new SolidColorBrush(Colors.Violet);
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
